package flex.persistence {
	public class LockModeType extends AbstractType {
		protected static var localInstantiation:Boolean = false;

		private static var _READ:LockModeType; 
		public static function get READ():LockModeType {
			if(!_READ) { 
				localInstantiation = true;
				_READ = new LockModeType("READ");
				localInstantiation = false;
			}
			return _READ;
		} 
		private static var _WRITE:LockModeType; 
		public static function get WRITE():LockModeType {
			if(!_WRITE) { 
				localInstantiation = true;
				_WRITE = new LockModeType("WRITE");
				localInstantiation = false;
			}
			return _WRITE;
		} 
			
		public static function valueOf(name:String):LockModeType {
			for each(var val:LockModeType in values()) {
				if(val.name.toUpperCase() == name.toUpperCase()) return val;
			}
			return null;
		}
		
		public static function values():Array {
			return [READ, WRITE];
		}
		
		
		public function LockModeType(name:String) {
			if(!localInstantiation) throw Error("Private constructor");
			this.name = name;
		}
		
	}
}